package com.zhoukx.command;

/**
 * @ClassName ConcreteCommand
 * @Description:
 * @Author zhoukx
 * @Date 2020/8/17
 **/
// 命令模式
public class LightOnCommand implements Command {
   // 聚合LightRecever
    LightReceiver light;
    // 构造器

    public LightOnCommand(LightReceiver light) {
        this.light = light;
    }

    @Override
    public void execute() {
        // 调用接受者的方法
        light.on();

    }

    @Override
    public void undo() {
      light.off();
    }
}
